package com.ruoyi.am.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.am.mapper.AmRosterLogMapper;
import com.ruoyi.am.domain.AmRosterLog;
import com.ruoyi.am.service.IAmRosterLogService;
import com.ruoyi.common.core.text.Convert;

/**
 * 调班记录Service业务层处理
 * 
 * @author hkkk
 * @date 2020-12-09
 */
@Service
public class AmRosterLogServiceImpl implements IAmRosterLogService 
{
    @Autowired
    private AmRosterLogMapper amRosterLogMapper;

    /**
     * 查询调班记录
     * 
     * @param id 调班记录ID
     * @return 调班记录
     */
    @Override
    public AmRosterLog selectAmRosterLogById(Long id)
    {
        return amRosterLogMapper.selectAmRosterLogById(id);
    }

    /**
     * 查询调班记录列表
     * 
     * @param amRosterLog 调班记录
     * @return 调班记录
     */
    @Override
    public List<AmRosterLog> selectAmRosterLogList(AmRosterLog amRosterLog)
    {
        return amRosterLogMapper.selectAmRosterLogList(amRosterLog);
    }

    /**
     * 新增调班记录
     * 
     * @param amRosterLog 调班记录
     * @return 结果
     */
    @Override
    public int insertAmRosterLog(AmRosterLog amRosterLog)
    {
        amRosterLog.setCreateTime(DateUtils.getNowDate());
        return amRosterLogMapper.insertAmRosterLog(amRosterLog);
    }

    /**
     * 修改调班记录
     * 
     * @param amRosterLog 调班记录
     * @return 结果
     */
    @Override
    public int updateAmRosterLog(AmRosterLog amRosterLog)
    {
        return amRosterLogMapper.updateAmRosterLog(amRosterLog);
    }

    /**
     * 删除调班记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAmRosterLogByIds(String ids)
    {
        return amRosterLogMapper.deleteAmRosterLogByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除调班记录信息
     * 
     * @param id 调班记录ID
     * @return 结果
     */
    @Override
    public int deleteAmRosterLogById(Long id)
    {
        return amRosterLogMapper.deleteAmRosterLogById(id);
    }
}
